import type { RouteRecordRaw } from 'vue-router'
import Layout from '@/layouts/index.vue'
/**
 * staticRouter[静态路由]
 */
const staticRouter: RouteRecordRaw[] = [
  {
    path: '/',
    name: 'layout',
    component: Layout, // 登录进入这个页面，这个页面是整个布局
    redirect: '/index', // path路径，<router-link name="/404"> 也是使用path进行跳转
    children: [
      {
        path: '/index',
        component: () => import('@/views/home/index.vue'),
        meta: {
          title: '主页',
          name: 'index',
          icon: 'House',
          isHide: false,
          isKeepAlive: true,
          isTag: true,
          permission: '',
        },
      },
    ],
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/login/index.vue'),
    meta: {
      title: '',
      name: 'login',
      icon: '',
      isHide: true,
      isKeepAlive: false,
      isTag: false,
      permission: '',
    },
  },
  {
    path: '/404',
    name: '404',
    component: () => import('@/views/error/404.vue'),
    meta: {
      title: '404',
      name: '404',
      icon: '',
      isHide: true,
      isKeepAlive: false,
      isTag: false,
      permission: '',
    },
  },
  // 找不到path将跳转404页面
  {
    path: '/:pathMatch(.*)*',
    component: () => import('@/views/error/404.vue'),
    meta: {
      title: '404',
      name: '404',
      icon: '',
      isHide: true,
      isKeepAlive: false,
      isTag: false,
      permission: '',
    },
  },
]

export default staticRouter
